import re
import urllib.request



pat1 = '<div id="plist" .+ <div class="page clearfix">'
url = 'https://list.jd.com/list.html?cat=9987,653,655&page=2'

req = urllib.request.Request(url)
req.add_header('User-Agent','Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36')


html1 = urllib.request.urlopen(req).read()
print(html1)
html1 = str(html1)
result1 = re.compile(pat1).findall(html1)
print(result1[0])

pat2 = '<img width="220" height="220" data-img="1" data-lazy-img="//(.+?\.jpg)">'
imagelist = re.compile(pat2).findall(result1[0])
print(len(imagelist))

